In optimizeComponents be sure to also remove components that are defined in the primitive with empty object #780
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In optimizeComponents used by the copy entity to clipboard feature, be sure to also remove components that are defined in the primitive with empty object, for example a-camera here https://github.com/aframevr/aframe/blob/a26768db5fe0f04a3b8fec3e73780b1855c3c75c/src/extras/primitives/primitives/a-camera.js#L5-L7
defaultComponentsFromPrimitive
is defined bythis.defaultComponentsFromPrimitive = definition.defaultComponents || definition.defaultAttributes || {};
in aframe registerPrimitive. https://github.com/aframevr/aframe/blob/a26768db5fe0f04a3b8fec3e73780b1855c3c75c/src/extras/primitives/primitives.js#L37defaultComponents
is only on the definition, never on the html element, so checking forsource.defaultComponents
is always undefined from my understanding.I modified
getInjectedValue
to check onlydefaultComponentsFromPrimitive
and don't create unnessary object if it's undefined.Also in
getMixedValue
, the linesource.mixinEls.reverse()
was reversing the mixinEls in place, so the order changed on each execution, not really what we want here, I replaced bytoReversed()
getImplicitValue
didn't return isInherited true in case of empty object in the primitivedefaultComponents
, so the component wasn't deleted as part of theif (isInherited && doesNotNeedUpdate)
check.aframe-inspector/src/lib/entity.js
Lines 201 to 202 in ebb07fa
I fixed it.
Before:
After:
raycaster
is set by thecursor
component so that's why it still shows up, but I don't mind, it's good practice to define objects property inraycaster
anyway.Before:
After: